--
-- 释放锁
-- User: yuwenrong
-- Date: 2023-04-07
--
-- key
local key1 = KEYS[1];      --解锁key
-- 入参
local lockVal = ARGV[1];    --加锁因子

local res = redis.call('get', key1)
if (res == lockVal) then
    local returnVal = redis.call('del', key1)
    return returnVal .. ""
else
    return "0"
end